﻿using System;
using System.Text;

namespace RuTrackerLib
{
    public static class StringEncryptor
    {
        public static string Encrypt(string queryString)
        {
            return !string.IsNullOrEmpty(queryString)
                       ? Convert.ToBase64String(Encoding.UTF8.GetBytes(queryString))
                       : string.Empty;

        }

        public static string Decrypt(string base64String)
        {
            return !string.IsNullOrEmpty(base64String)
                       ? Encoding.UTF8.GetString(Convert.FromBase64String(base64String))
                       : string.Empty;
        }
    }
}
